package com.dc.controller;

import com.dc.common.ResponseResultVO;
import com.dc.entity.ro.ShiftManagementRO;
import com.dc.model.ShiftManagement;
import com.dc.service.ShiftManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "交接班管理")
@RestController
@RequestMapping("/shiftManagement")
public class ShiftManagementController {

    @Resource
    private ShiftManagementService shiftManagementService;

    @ApiOperation(value = "增加", notes = "增加")
    @PostMapping("/insertShiftManagement")
    public ResponseResultVO insertShiftManagement(@RequestBody ShiftManagement dto) {
        return shiftManagementService.insertShiftManagement(dto);
    }

    @ApiOperation(value = "点击确认交接班", notes = "点击确认交接班")
    @PostMapping("/updateShiftManagement")
    public ResponseResultVO updateShiftManagement(@RequestBody ShiftManagementRO ro) {
        return shiftManagementService.updateShiftManagement(ro);
    }

    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteShiftManagement")
    public ResponseResultVO deleteShiftManagement(@RequestParam String id) {
        return shiftManagementService.deleteShiftManagement(id);
    }

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/selectShiftManagementList")
    public ResponseResultVO selectShiftManagementList(@RequestBody ShiftManagementRO ro) {
        return shiftManagementService.selectShiftManagementList(ro);
    }
}
